﻿using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

// ReSharper disable InconsistentNaming
namespace Samurai.Wakizashi.Tests
{
    [TestClass]
    public class EnumerableExtensionMethods_Test
    {
        [TestMethod]
        public void Performs_specified_action_on_each_item_in_an_enumerable_collection()
        {
            var testList = new List<DummyClass>(3) {new DummyClass(), new DummyClass(), new DummyClass()};
            testList.Each(dc => dc.SomeFlag = true);

            Assert.IsTrue(testList.Count(dc => dc.SomeFlag) == 3);
        }

        private class DummyClass
        {
            public bool SomeFlag { get; set; }
        }
    }
}
// ReSharper restore InconsistentNaming